/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package layer;

import event.JobAlarmEvent;
import event.JobConfirmEvent;
import event.JobRequestEvent;
import event.JobStatusEvent;
import net.sf.appia.core.Layer;
import net.sf.appia.core.Session;
import net.sf.appia.core.events.channel.ChannelInit;
import session.ApplicationSession;

/**
 *
 * @author Welington
 */
public class ApplicationLayer extends Layer {

    public ApplicationLayer() {
        /* events that the protocol will create */
        evProvide = new Class[1];
        evProvide[0] = JobRequestEvent.class;

        /*
         * events that the protocol requires to work. It is a subset of the
         * accepted events.
         */
        evRequire = new Class[0];

        /* events that the protocol will accept */
        evAccept = new Class[4];
        evAccept[0] = JobConfirmEvent.class;
        evAccept[1] = JobStatusEvent.class;
        evAccept[2] = JobAlarmEvent.class;
        evAccept[3] = ChannelInit.class;
    }

    @Override
    public Session createSession() {
        return new ApplicationSession(this);
    }
}
